home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / networking / mail / smail / smail.diff-3.1.21-3.1.22 < prev    next >
Encoding:
Text File  |  1991-07-31  |  58.4 KB  |  2,138 lines

  1. --------------------------------------------------------------------
  2. Notes about this patch:
  3.  
  4. o   src/transports/pipe.c now includes <ctype.h>.
  5.  
  6. o   src/transports/appendfile.c can now use SVR3 method for getting
  7.     struct utimbuf, or it can declare the structure itself, for
  8.     systems that don't seem to declare it anywhere.
  9.  
  10. o   Repaired the bind code, after all the errors that were introduced
  11.     in the new features added in 3.1.21.  Somebody please check out
  12.     the changes, since I am not running bind anywhere and am not on
  13.     the Internet.
  14.  
  15. o   Recent map entries have included an additional, unexpected, blank
  16.     line that was causing unsharmap to fail.  unsharmap is now
  17.     tolerant of these blank lines.
  18.  
  19. o   For Interactive UNIX users, there is a workaround for the fact
  20.     that signals during accept() are not handled by interrupting the
  21.     system call with EINTR.
  22.  
  23. o   Added support for SGI IRIX version 3.3 and some specific support
  24.     for SunOS4.1.
  25.  
  26. o   Installing binaries will use mcs, if it exists, to strip commentary
  27.     information, in addition to the information removed by "strip".
  28.  
  29. o   The OTHER_SMAIL_NAMES variable can now be a space or colon-separated
  30.     list.  Previously, colons could not be used as separators, which
  31.     was very confusing.
  32.  
  33. o   Added message grade selection criteria to method files.  This
  34.     allows message precedence values to influence the choice of
  35.     transport.  See the section on method file formats in the smail(5)
  36.     man page for more information.
  37.  
  38. o   Fixed a number of traditional versus ANSI C problems, in both
  39.     directions.  Some fixes related to the fact that 3.1.21 was
  40.     tested only with ANSI C compilers.  Other fixes handle additional
  41.     warning messages that I ignored for 3.1.21.
  42.  
  43. o   Fixed a potential data alignment problem in uuwho that could cause
  44.     uuwho to dump core on some architectures or with some DBM variants.
  45.  
  46. o   Attempted to repair the damage caused by including additional time
  47.     header files in main.c.  If anyone encounters additional problems,
  48.     please let me know (I hate header files :-].
  49.  
  50. o   When waiting for children of the queue-run daemon, on a BSD system,
  51.     smail will now wait for all children in the signal handler.
  52.     The previous releases would wait for exactly one child, which
  53.     didn't cleanup all children, if two children died between calls
  54.     to the handler.
  55. --------------------------------------------------------------------
  56. The following changes should be applied to the version 3.1.21
  57. sources for smail, to produce smail3.1.22.  The version number
  58. that you are running can be found in the `level' file at the top of
  59. the source tree.  It can also be found by running the command:
  60.  
  61.     smail -V -v
  62.  
  63. For information on smail releases and how you can obtain a complete
  64. smail release or a patch release, send mail to the address:
  65.  
  66.     smail-patch@veritas.com
  67.  
  68. or to the !-style address:
  69.  
  70.     ...{amdahl,apple,pyramid,uunet}!veritas!smail-patch
  71.  
  72. include as the first line of the message one of the following lines:
  73.  
  74.     send help <addr>
  75.     send index <addr>
  76.     send patch <num> <addr>
  77.  
  78. where <num> is a single patch number (e.g., 17) or a single patch range
  79. (e.g., 4-7) and where <addr> is your address relative to veritas.  The
  80. <addr> is optional and if omitted your return path is used.
  81.  
  82. The following patch should be applied to the smail3.1.21 release.  To
  83. apply this patch, obtain a copy of the program patch, release 2.0 or
  84. higher.  The patch utility has been posted to the USENET group
  85. comp.sources.unix, and is available from most sites that archive
  86. public domain programs.  Apply this patch using the command:
  87.  
  88.     patch -p [-d /SMAIL_SOURCE_PATH] < this_patch_file
  89.  
  90. where "-d /SMAIL_SOURCE_PATH" specifies a root based path to the top of
  91. the smail source tree, and where "patchfile" is the name of the file in
  92. which this patch is stored.  The "-d /SMAIL_SOURCE_PATH" is not needed
  93. if the current directory is already the top of the smail source tree.
  94.  
  95. NOTE: Don't forget the -p !!!!!
  96.  
  97. Prereq: PATCH_NUMBER=21
  98. Index: patchnum
  99. ***************
  100. *** 1,3 ****
  101. ! # @(#)patchnum    1.4 28 May 1991 22:09:40
  102. ! PATCH_NUMBER=21
  103. ! PATCH_DATE=28-may-91
  104. --- 1,3 ----
  105. ! # @(#)patchnum    1.5 24 Jul 1991 18:52:33
  106. ! PATCH_NUMBER=22
  107. ! PATCH_DATE=24-jul-91
  108.  
  109. Prereq: 3.1.21.1
  110. Index: level
  111. ***************
  112. *** 1,2 ****
  113. ! # @(#)level    1.4 28 May 1991 22:09:32
  114. ! 3.1.21.1 Tue May 28 22:07:09 PDT 1991
  115. --- 1,2 ----
  116. ! # @(#)level    1.5 24 Jul 1991 18:52:28
  117. ! 3.1.22.1 Wed Jul 24 18:51:49 PDT 1991
  118.  
  119. Index: conf/os/irix3.3
  120. ***************
  121. *** 0 ****
  122. --- 1,38 ----
  123. + # @(#)conf/os/irix3.3    1.1 24 Jul 1991 %U
  124. + #
  125. + # irix3.3 - describe characteristics of SGI IRIX version 3.3
  126. + #
  127. + # contributed by lyndon@cs.athabascau.ca
  128. + . $ROOT/conf/os/sys5.3
  129. + # OSNAMES - add POSIX_OS to list of names, since it is POSIX-compliant
  130. + OSNAMES="$OSNAMES:POSIX_OS"
  131. + # OSLIBS(list) - name any object libraries containing routines we will need
  132. + OSLIBS="-lPW -lsun -lc_s"
  133. + # DRIVER_CONFIGURATION(variable) - configuration file describing smail drivers
  134. + DRIVER_CONFIGURATION=arpa-network        # includes BIND/DNS router
  135. + # HAVE(list) - list of attributes identified for your operating system
  136. + HAVE=$HAVE:RENAME:MKDIR:BSD_NETWORKING:SYSEXITS:NDBM:YP:GETHOSTNAME
  137. + HAVE=$HAVE:ULIMIT:RLIMIT
  138. + # NOBODY(variable) - username to use for annonymous situations
  139. + NOBODY=nobody        # BSD and SunOS-like systems
  140. + # SECURE_PATH(variable) - a secure, :-separated list of exectuable directories
  141. + SECURE_PATH=/bin:/usr/bin:/usr/bsd
  142. + # COMPRESS(variable) - an executable that compresses files
  143. + # COMP_FLAG(variable) - flag to use to force compression
  144. + # DOT_Z(variable) - suffix generated by compression program
  145. + # UNCOMPRESS(variable) - program to uncompress files
  146. + # ZCAT(variable) - program to write contents of compressed files to stdout
  147. + COMPRESS=compress        # for compress
  148. + COMP_FLAG=-f
  149. + DOT_Z=.Z
  150. + UNCOMPRESS=uncompress
  151. + ZCAT=zcat
  152.  
  153. Index: conf/os/sun_os4.1
  154. ***************
  155. *** 0 ****
  156. --- 1,13 ----
  157. + # @(#)conf/os/sun_os4.1    1.2 24 Jul 1991 01:04:09
  158. + #
  159. + # sun_os4.1 - define the characteristics of SunOS release 4.1
  160. + #
  161. + # contributed by bruce@pooh.com
  162. + . $ROOT/conf/os/sun_os4
  163. + # MAILBOX_DIR - in which directory are user mailbox files
  164. + MAILBOX_DIR=/var/spool/mail
  165. + # UUCP_SYSTEM_FILE - path to UUCP file containing remote systems
  166. + UUCP_SYSTEM_FILE=/etc/uucp/Systems
  167.  
  168. Index: README
  169. ***************
  170. *** 58,159 ****
  171.       delivery_mode=queued
  172.   
  173.   
  174. ! CHANGES IN THE 3.1.21 RELEASE
  175.   
  176. ! Release 3.1.21 is a patch release to smail3.1.20, which was a limited
  177. ! release of smail.  The 3.1.20 release included significant work on the
  178. ! OS-configuration aspects of smail.  The 3.1.21 is primarily a bug fix
  179. ! release.  All of the enhancements are limited in scope.
  180.   
  181. ! Some changes in 3.1.21 are:
  182.   
  183. ! 1.  Smail now tries to preserve the access time for mailbox files.
  184. !     This allows programs to compare the access time and modification
  185. !     time of mailbox files to determine if mail has arrived.  The
  186. !     usability of this depends upon your mail user interface.
  187.   
  188. ! 2.  Added some optimization options to the DNS router driver (bind)
  189. !     to prevent lookups for domains that are known not to be in the
  190. !     DNS, or for names that apparently are not domains.
  191.   
  192. ! 3.  Added support to the bind router for delivering mail only
  193. !     to those sites with MX records.  This is useful for some local
  194. !     area networks, but is generally not advisable on the Internet.
  195.   
  196. - 4.  Enhanced the /bin/mail "replacement" (in pd/binmail) to support
  197. -     options of the SVR3 and SVR4 versions of /bin/mail.
  198. - 5.  Added support for HP-UX 7.0 and A/UX 2.0.
  199. - 6.  Better debugging messages are now generated, including complete
  200. -     expanded headers, plus filenames (for appendfile) and shell
  201. -     commands (for the pipe driver).  Use a debugging level of at
  202. -     least 6 to get all of the new debugging output.
  203.   Some bugs that were fixed:
  204.   
  205. ! 1.  Fixed a bug in the bind router that was resulting in considering
  206. !     some MX entries for a host to be invalid.  The problem fixed was
  207. !     that the GETSHORT macro was being called with a regular char *
  208. !     rather than an unsigned char *.  On some machines that supply
  209. !     a GETSHORT macro, this resulted in inappropriate sign extensions.
  210.   
  211. ! 2.  One C compiler (pcc for microport/286) couldn't handle four
  212. !     HDREQ() macro calls in an if statement.  These were broken up
  213. !     into two if statements.
  214.   
  215. ! 3.  The help message printed by SMTP was in a single, multi-line
  216. !     string which was too long for some compilers (Xenix/286).  This
  217. !     was broken up into multiple strings.
  218.   
  219. ! 4.  Several people pointed out that their systems could not include
  220. !     both <sys/time.h> and <time.h>, as was done in src/main.c.  Only
  221. !     one of these will now be included, based on os-type.
  222.   
  223. ! 5.  The fwdfile director driver was calling xprintf with the wrong
  224. !     number of arguments, if a parsing error was encountered in a
  225. !     mailing list or .forward file, sometimes causing a core dump,
  226. !     often generating less than meaningful error messages.
  227.   
  228. ! 6.  Some machines do not support the <<-EOF construct (indented here
  229. !     documents) in /bin/sh.  Uses of this construct were removed.
  230.   
  231. ! 7.  Shell scripts in the util source directory were not having the
  232. !     X_UTIL_PATH_X replaced by a propper set of directories.  This
  233. !     resulted from the changes to mkdefs.sh in release 3.1.20.  This
  234. !     has been fixed.
  235.   
  236. ! 8.  On some systems (Motorola V.3.2), use of greater than 14 character
  237. !     file names results in failure rather than name truncation.  This
  238. !     was a problem for the installation procedure which uses four-
  239. !     character suffixes (.OLD and .NEW).  These suffixes have been
  240. !     changed to .O and .N.
  241.   
  242. ! 9.  When using the malloc library supplied with SVR3, a structure
  243. !     cannot be referenced after it is freed.  One known use of a
  244. !     freed structure (in smtprecv.c) was modified.
  245.   
  246. ! 10. I found another case where an @user@host address was being
  247. !     generated, in smtplib.c.
  248.   
  249. - 11. Smail for SunOS will not compile correctly if /usr/5bin is in
  250. -     your PATH before /bin.  To compensate, the sun_os4 conf/os file
  251. -     sets CC to /bin/cc explicitly.
  252.   
  253. - 12. The gethostbyname router driver was returning a NULL rather than
  254. -     DB_NOMATCH in one case, causing occasionally incorrect behavior.
  255. - 13. Fixed some problems with pathalias, including some problems with
  256. -     ANSI C compilers, and a potential loop in generated output which
  257. -     was exhibited at some sites by more recent postings of the USENET
  258. -     map database.
  259. - 14. The handling of :include: files would occasionally result in
  260. -     inappropriate errors.  This resulted from functions that were
  261. -     supposed to return a value but instead had implicit returns.
  262. -     The common symptom was an error message with a blank error.
  263.   FUTURE SMAIL3 RELEASES
  264.   
  265.   Smail development has been on hold for quite a while, because the only
  266. --- 58,124 ----
  267.       delivery_mode=queued
  268.   
  269.   
  270. ! CHANGES IN THE 3.1.22 RELEASE
  271.   
  272. ! Release 3.1.22 is a patch release to smail3.1.21.  It is primarily
  273. ! a bug fix release.  All of the enhancements are limited in scope.
  274.   
  275. ! Some changes in 3.1.22 are:
  276.   
  277. ! 1.  Added message-grade selection selection criteria to method files.  This
  278. !     allows message precedence values to influence the choice of
  279. !     transport.  See the section on method file formats in the smail(5)
  280. !     man page for more information.
  281.   
  282. ! 2.  Added support for SGI IRIX version 3.3, and for SunOS4.1.
  283.   
  284. ! 3.  Installing binaries will use mcs, if it exists, to strip commentary
  285. !     information, in addition to the information removed by "strip".
  286.   
  287.   Some bugs that were fixed:
  288.   
  289. ! 1.  src/transports/pipe.c now includes <ctype.h>.
  290.   
  291. ! 2.  src/transports/appendfile.c can now use SVR3 method for getting
  292. !     struct utimbuf, or it can declare the structure itself, for
  293. !     systems that don't seem to declare it anywhere.
  294.   
  295. ! 3.  Repaired the bind code, after all the errors that were introduced
  296. !     in the new features added in 3.1.21.  Somebody please check out
  297. !     the changes, since I am not running bind anywhere and am not on
  298. !     the Internet.
  299.   
  300. ! 4.  Recent map entries have included an additional, unexpected, blank
  301. !     line that was causing unsharmap to fail.  unsharmap is now
  302. !     tolerant of these blank lines.
  303.   
  304. ! 5.  For Interactive UNIX users, there is a workaround for the fact
  305. !     that signals during accept() are not handled by interrupting the
  306. !     system call with EINTR.
  307.   
  308. ! 6.  The OTHER_SMAIL_NAMES variable can now be a space or colon-separated
  309. !     list.  Previously, colons could not be used as separators, which
  310. !     was very confusing.
  311.   
  312. ! 7.  Fixed a number of traditional versus ANSI C problems, in both
  313. !     directions.  Some fixes related to the fact that 3.1.21 was
  314. !     tested only with ANSI C compilers.  Other fixes handle additional
  315. !     warning messages that I ignored for 3.1.21.
  316.   
  317. ! 8.  Fixed a potential data alignment problem in uuwho that could cause
  318. !     uuwho to dump core on some architectures or with some DBM variants.
  319.   
  320. ! 9.  Attempted to repair the damage caused by including additional time
  321. !     header files in main.c.  If anyone encounters additional problems,
  322. !     please let me know (I hate header files :-].
  323.   
  324. ! 10. When waiting for children of the queue-run daemon, on a BSD system,
  325. !     smail will now wait for all children in the signal handler.
  326. !     The previous releases would wait for exactly one child, which
  327. !     didn't cleanup all children, if two children died between calls
  328. !     to the handler.
  329.   
  330.   
  331.   FUTURE SMAIL3 RELEASES
  332.   
  333.   Smail development has been on hold for quite a while, because the only
  334. ***************
  335. *** 310,315 ****
  336. --- 275,313 ----
  337.   though if you have any questions, or if you dispute this claim, please
  338.   send mail.  Sample configuration files can be found in the directory
  339.   samples/.
  340. + SMAIL AND SYSTEM V
  341. + System V systems typically have a /bin/mail program that both delivers
  342. + mail and reads mail.  Smail provides a replacement for the /bin/mail
  343. + program, in pd/binmail, that uses the old /bin/mail for reading mail,
  344. + and smail for delivering mail.  To use the replacement /bin/mail, you
  345. + will need to define the LMAIL variable in conf/EDITME.  See
  346. + conf/EDITME for more instructions.
  347. + The System V mailx utility will need to be updated to know how to find
  348. + smail.  Presuming that smail is installed as /usr/lib/sendmail, you
  349. + will need to add the following line to the file /usr/lib/mailx/mailx.rc:
  350. +     set sendmail=/usr/lib/sendmail
  351. + SMAIL AND SCO UNIX
  352. + Smail under SCO UNIX should be installed as both /bin/mail and
  353. + /usr/lib/mail/execmail.  To do this, set OTHER_SMAIL_NAMES in the
  354. + EDITME file to "/bin/rmail:/usr/lib/mail/execmail".  You will also
  355. + need to use the /bin/mail replacement in pd/binmail, just as in
  356. + System V.  Some newer SCO UNIX systems also have a /usr/bin/rmail, as
  357. + a link to /usr/bin/mailx.  This file should be deleted.
  358. + Some versions of SCO UNIX store mail messages in /usr/spool/mail,
  359. + while others use /usr/mail, like System V.  If your system uses
  360. + /usr/spool/mail, you will need to add the following line to the
  361. + conf/EDITME file:
  362. +     MAILBOX_DIR=/usr/spool/mail
  363.   
  364.   
  365.   PATCHES
  366.  
  367. Index: conf/EDITME-dist
  368. ***************
  369. *** 1,4 ****
  370. ! # @(#)conf/EDITME-dist    1.7 27 May 1991 15:16:41
  371.   #
  372.   # EDITME - edit me to perform high level configuration of smail
  373.   #
  374. --- 1,4 ----
  375. ! # @(#)conf/EDITME-dist    1.9 30 Jul 1991 23:12:28
  376.   #
  377.   # EDITME - edit me to perform high level configuration of smail
  378.   #
  379. ***************
  380. *** 45,62 ****
  381.   #CFLAGS="-g -C"                    # UTS/580 debug
  382.   
  383.   
  384. ! # LDFLAGS - flags to pass to the loader, including special libraries
  385.   #
  386.   # optional
  387.   #
  388. ! # These flags are passed to the cc command after any libraries or
  389. ! # flags specified in the conf/os file entry.
  390.   
  391. ! #LIBS="-lc_s"                # EXAMPLE: System V.3 shared libc
  392.   #if [ "$FROM_ROOT" = src ]; then    # EXAMPLE: The BIND resolver library
  393.   #    LIBS="-lresolv"            #  only used in the src
  394.   #fi                    #  directory
  395.   
  396.   # STRIP - define this if you wish to strip binaries when installing
  397.   #
  398.   # optional
  399. --- 45,84 ----
  400.   #CFLAGS="-g -C"                    # UTS/580 debug
  401.   
  402.   
  403. ! # LDFLAGS - flags to pass to the loader
  404.   #
  405.   # optional
  406.   #
  407. ! # These flags are passed to the cc command before any object
  408. ! # modules or libraries.
  409.   
  410. ! #LDFLAGS=-L/usr/ucblib            # use an alternate directory for libs
  411. ! #LDFLAGS="-L/usr/ucblib -Bstatic"    # and don't use shared libraries
  412. ! # LIBS - libraries to include in binaries
  413. ! #
  414. ! # optional
  415. ! #
  416. ! # These libraries are passed to the cc command before any libraries
  417. ! # mentioned in the conf/os file.  It can be used to link in additional
  418. ! # libraries before the system libraries.
  419.   #if [ "$FROM_ROOT" = src ]; then    # EXAMPLE: The BIND resolver library
  420.   #    LIBS="-lresolv"            #  only used in the src
  421.   #fi                    #  directory
  422.   
  423. + # OSLIBS - ending libraries to include in binaries
  424. + #
  425. + # optional
  426. + #
  427. + # These libraries are passed to the cc command after all other
  428. + # libraries from any other source.  For example, this can be used
  429. + # to force the use of an alternate C library, or a shared version
  430. + # of the C library.
  431. + #OSLIBS=-lc_s                # SVR3 shared C library
  432.   # STRIP - define this if you wish to strip binaries when installing
  433.   #
  434.   # optional
  435. ***************
  436. *** 176,181 ****
  437. --- 198,231 ----
  438.   #    directory and "make install" explicitly.
  439.   
  440.   #LMAIL=/bin/lmail                # standard System V
  441. + # MISC_DEFINES - miscellaneous definitions
  442. + #
  443. + # optional
  444. + #
  445. + # A colon-separated list that names miscellaneous macros to define
  446. + # for C programs and shell scripts.  Each entry in the list can be
  447. + # a simple name, or the name can be followed by an equal sign to
  448. + # provide a value.  For example:
  449. + #
  450. + #    MISC_DEFINES="void=int:DECLARE_UTIMBUF"
  451. + #
  452. + # Defines void to be int for compilers that do not correctly support
  453. + # the void type, and declares the macro DECLARE_UTIMBUF, so that smail
  454. + # will not try to get the utimbuf structure from a header file.
  455. + #
  456. + # IMPORTANT FOR INTERACTIVE UNIX USERS:
  457. + #
  458. + # Some versions of Interactive UNIX have a <sys/socket.h> header
  459. + # file that directly includes the <time.h> header file, which is
  460. + # not protected against multiple inclusion.  If your system has
  461. + # this problem, you will encounter a multiple declaration problem
  462. + # when compiling src/modes.o.  To repair the situation, use:
  463. + #
  464. + #    MISC_DEFINES=ISC_SOCKET_TIME_BUG
  465. + #MISC_DEFINES=ISC_SOCKET_TIME_BUG
  466.   
  467.   
  468.   # HOSTNAMES - names for the local host
  469.  
  470. Index: conf/lib/inst.sh
  471. ***************
  472. *** 1,6 ****
  473.   :
  474.   #!/bin/sh
  475. ! # @(#)conf/lib/inst.sh    1.3 11 May 1991 19:25:32
  476.   # Install a file under a list of names.
  477.   #
  478.   # usage: sh inst.sh [-lsr] [-u user] [-g group] [-m mode] [-d dir] src [dst...]
  479. --- 1,6 ----
  480.   :
  481.   #!/bin/sh
  482. ! # @(#)conf/lib/inst.sh    1.4 23 Jul 1991 22:23:52
  483.   # Install a file under a list of names.
  484.   #
  485.   # usage: sh inst.sh [-lsr] [-u user] [-g group] [-m mode] [-d dir] src [dst...]
  486. ***************
  487. *** 214,220 ****
  488.           continue
  489.       fi
  490.       case "$strip" in
  491. !     ?*)    strip "$new";;
  492.       esac
  493.       case "$user" in
  494.       ?*)    if $dbg chown "$user" "$new"; then
  495. --- 214,224 ----
  496.           continue
  497.       fi
  498.       case "$strip" in
  499. !     ?*)    strip "$new"
  500. !         if [ -x /usr/bin/mcs ]; then
  501. !             mcs -d "$new"
  502. !         fi
  503. !         ;;
  504.       esac
  505.       case "$user" in
  506.       ?*)    if $dbg chown "$user" "$new"; then
  507.  
  508. Index: conf/lib/instm.sh
  509. ***************
  510. *** 1,6 ****
  511.   :
  512.   #!/bin/sh
  513. ! # @(#)conf/lib/instm.sh    1.3 11 May 1991 19:25:40
  514.   # Install a set of files into a directory
  515.   #
  516.   # usage: sh instm.sh [-sr] [-u user] [-g group] [-m mode] dir file...
  517. --- 1,6 ----
  518.   :
  519.   #!/bin/sh
  520. ! # @(#)conf/lib/instm.sh    1.4 23 Jul 1991 22:23:56
  521.   # Install a set of files into a directory
  522.   #
  523.   # usage: sh instm.sh [-sr] [-u user] [-g group] [-m mode] dir file...
  524. ***************
  525. *** 81,87 ****
  526.           continue
  527.       fi
  528.       case "$strip" in
  529. !     ?*)    strip "$new";;
  530.       esac
  531.       case "$user" in
  532.       ?*)    if $dbg chown "$user" "$new"; then
  533. --- 81,91 ----
  534.           continue
  535.       fi
  536.       case "$strip" in
  537. !     ?*)    strip "$new"
  538. !         if [ -x /usr/bin/mcs ]; then
  539. !             mcs -d "$new"
  540. !         fi
  541. !         ;;
  542.       esac
  543.       case "$user" in
  544.       ?*)    if $dbg chown "$user" "$new"; then
  545.  
  546. Index: conf/lib/mkdefs.sh
  547. ***************
  548. *** 1,5 ****
  549.   #!/bin/sh
  550. ! # @(#)conf/lib/mkdefs.sh    1.10 29 May 1991 02:09:16
  551.   
  552.   #    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  553.   # 
  554. --- 1,5 ----
  555.   #!/bin/sh
  556. ! # @(#)conf/lib/mkdefs.sh    1.14 24 Jul 1991 00:13:52
  557.   
  558.   #    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  559.   # 
  560. ***************
  561. *** 28,34 ****
  562.    USE_SYMLINKS\
  563.    SMAIL_BIN_DIR\
  564.    SMAIL_NAME\
  565. -  OTHER_SMAIL_NAMES\
  566.    NEWALIASES\
  567.    LIB_DIR\
  568.    UNSHAR_MAP_DIR\
  569. --- 28,33 ----
  570. ***************
  571. *** 89,94 ****
  572. --- 88,94 ----
  573.    OSNAMES\
  574.    LIBS\
  575.    OSLIBS\
  576. +  OTHER_SMAIL_NAMES\
  577.   "
  578.   
  579.   # lists to append together with newlines
  580. ***************
  581. *** 106,111 ****
  582. --- 106,112 ----
  583.   
  584.   # separators for list variables
  585.   sep=":$IFS"
  586. + save_IFS="$IFS"
  587.   
  588.   # clear all EDITME/OS/ARCH variables
  589.   for v in $VARS $LISTS $NLISTS; do
  590. ***************
  591. *** 219,228 ****
  592.   esac
  593.   
  594.   case "$SPOOL_DIRS" in
  595. ! *:* ) MAIN_SPOOL_DIR="`sed 's/:.*//' <<EOF
  596. ! $SPOOL_DIRS
  597. ! EOF
  598. !     `" ;;
  599.   *   ) MAIN_SPOOL_DIR="$SPOOL_DIRS" ;;
  600.   esac
  601.   case "$LOG_DIR" in
  602. --- 220,226 ----
  603.   esac
  604.   
  605.   case "$SPOOL_DIRS" in
  606. ! *:* ) MAIN_SPOOL_DIR=`expr "\$SPOOL_DIRS" : '\([^:]*\):.*'`;;
  607.   *   ) MAIN_SPOOL_DIR="$SPOOL_DIRS" ;;
  608.   esac
  609.   case "$LOG_DIR" in
  610. ***************
  611. *** 347,353 ****
  612.   # as needed
  613.   for v in $HAVE_REQUIRE; do
  614.       found=no
  615. -     save_IFS="$IFS"
  616.       IFS="$sep"
  617.       for v2 in $HAVE; do
  618.           case "$v" in
  619. --- 345,350 ----
  620. ***************
  621. *** 370,375 ****
  622. --- 367,384 ----
  623.       esac
  624.   done
  625.   
  626. + # replace : with ' ' in the OTHER_SMAIL_NAMES variable
  627. + list=$OTHER_SMAIL_NAMES
  628. + OTHER_SMAIL_NAMES=
  629. + IFS=$sep
  630. + for i in $list; do
  631. +     case "$OTHER_SMAIL_NAMES" in
  632. +     ?*)    OTHER_SMAIL_NAMES="$OTHER_SMAIL_NAMES $i";;
  633. +     *)    OTHER_SMAIL_NAMES="$i";
  634. +     esac
  635. + done
  636. + IFS=$save_IFS
  637.   echo "done" 1>&2
  638.   
  639.   # if DRIVER_CONFIGURATION does not begin with /, put it under the
  640. ***************
  641. *** 447,452 ****
  642. --- 456,462 ----
  643.   OLD_LOGDIR='$OLD_LOGDIR'
  644.   MAIN_SPOOL_DIR='$MAIN_SPOOL_DIR'
  645.   EDITME='$EDITME'
  646. + OS_TYPE='$OS_TYPE'
  647.   $MISC_SH_DEFINES
  648.   EOF
  649.   
  650. ***************
  651. *** 509,514 ****
  652. --- 519,525 ----
  653.           -e 's/\([A-Z0-9_]*\)=\(..*\)/#define \1        "\2"/p' \
  654.           -e 's/\([A-Z0-9_]*\)=$/#define \1        NULL/p'
  655.   EDITME=$EDITME
  656. + OS_TYPE=$OS_TYPE
  657.   RELATIVE_EDITME=$RELATIVE_EDITME
  658.   MAIN_SPOOL_DIR=$MAIN_SPOOL_DIR
  659.   HOSTNAMES=$HOSTNAMES
  660. ***************
  661. *** 589,594 ****
  662. --- 600,606 ----
  663.   s|X_OLD_LOGDIR_X|$OLD_LOGDIR|g
  664.   s|X_MAIN_SPOOL_DIR_X|$MAIN_SPOOL_DIR|g
  665.   s|X_EDITME_X|$EDITME|g
  666. + s|X_OS_TYPE_X|$OS_TYPE|g
  667.   EOF
  668.   
  669.   # write out the simple variables.  Ignore variables with newlines or | chars
  670.  
  671. Index: conf/os/386ix
  672. ***************
  673. *** 1,4 ****
  674. ! # @(#)conf/os/386ix    1.2 27 May 1991 15:24:04
  675.   #
  676.   # 386ix - define the characteristics of Interactive 386/IX with networking
  677.   #
  678. --- 1,4 ----
  679. ! # @(#)conf/os/386ix    1.4 24 Jul 1991 01:40:52
  680.   #
  681.   # 386ix - define the characteristics of Interactive 386/IX with networking
  682.   #
  683. ***************
  684. *** 14,17 ****
  685.   DRIVER_CONFIGURATION=bsd-network
  686.   
  687.   # HAVE - what features should be used with this operating system
  688. ! HAVE=$HAVE:MKDIR:BSD_NETWORKING:GETHOSTNAME:
  689. --- 14,23 ----
  690.   DRIVER_CONFIGURATION=bsd-network
  691.   
  692.   # HAVE - what features should be used with this operating system
  693. ! HAVE=$HAVE:MKDIR:BSD_NETWORKING:GETHOSTNAME
  694. ! # MISC_DEFINES - miscellaneous things to put in the defs files
  695. ! #
  696. ! # DECLARE_UTIMBUF - utimbuf is not always declared in <sys/time.h>
  697. ! # ISC_ACCEPT_BUG  - accept() not interruptible, use select() first
  698. ! MISC_DEFINES=DECLARE_UTIMBUF:ISC_ACCEPT_BUG
  699.  
  700. Index: conf/os/template
  701. ***************
  702. *** 1,4 ****
  703. ! # @(#)conf/os/template    1.4 02 Dec 1990 23:49:57
  704.   #
  705.   # template - template for operating system configuration description
  706.   #
  707. --- 1,4 ----
  708. ! # @(#)conf/os/template    1.5 24 Jul 1991 00:39:40
  709.   #
  710.   # template - template for operating system configuration description
  711.   #
  712. ***************
  713. *** 321,326 ****
  714. --- 321,332 ----
  715.   #        environment variable TZ to GMT0 if it is not already
  716.   #        set.
  717.   #
  718. + #    DECLARE_UTIMBUF
  719. + #        Some versions of System V do not define the utimbuf
  720. + #        structure in <sys/time.h>, or in <utime.h>.  If your
  721. + #        system is one of these, then define DECLARE_UTIMBUF,
  722. + #        and smail will define the utimbuf structure itself.
  723. + #
  724.   #    void=int
  725.   #        This must be used for systems that do not support the
  726.   #        void type.  In particular, some older systems that
  727. ***************
  728. *** 333,339 ****
  729.   #        If this yields an error then you will need to set
  730.   #        void=int.
  731.   
  732. ! #MISC_DEFINES=REQUIRE_TZ:void=int
  733.   
  734.   
  735.   # MISC_C_DEFINES(list) - miscellaneous C defines
  736. --- 339,345 ----
  737.   #        If this yields an error then you will need to set
  738.   #        void=int.
  739.   
  740. ! #MISC_DEFINES=REQUIRE_TZ:DECLARE_UTIMBUF:void=int
  741.   
  742.   
  743.   # MISC_C_DEFINES(list) - miscellaneous C defines
  744.  
  745. Index: man/man5/smail.an
  746. ***************
  747. *** 1,4 ****
  748. ! .\" @(#)man/man5/smail.an    1.7 28 May 1991 02:10:02
  749.   .de BD        '\% entry descriptions
  750.   .br
  751.   .TP
  752. --- 1,4 ----
  753. ! .\" @(#)man/man5/smail.an    1.8 24 Jul 1991 03:27:23
  754.   .de BD        '\% entry descriptions
  755.   .br
  756.   .TP
  757. ***************
  758. *** 1398,1403 ****
  759. --- 1398,1439 ----
  760.   This is a catch-all feature which should
  761.   only be used in the last entry in a
  762.   method file.
  763. + .PP
  764. + Entries in a method file can be associated with particular message
  765. + grades.  This allows different grades to use different transports,
  766. + such as non-demand UUCP for messages with a bulk or junk precedence.
  767. + Grade ranges are specified by appending a grade letter range to the
  768. + hostname, separated by \fB/\fP.  Entries with grades can be in any
  769. + of the forms:
  770. + .nf
  771. +     \fIhostname\fP/X    \fItransport-name\fP
  772. +     \fIhostname\fP/X-*    \fItransport-name\fP
  773. +     \fIhostname\fP/*-Y    \fItransport-name\fP
  774. +     \fIhostname\fP/X-Y    \fItransport-name\fP
  775. + .fi
  776. + See the definition of the \fBgrades\fP configuration variable for
  777. + a discussion of grade letters, and their correlation with message
  778. + precedence strings.  In the first form, the transport is used for
  779. + an exact match of the grade letter.  In the second form, a match
  780. + requires a grade a character value of at least X.  In the third, form
  781. + a match requires a grade character value of at most Y.  The final
  782. + form specifies a range of grades from character value X to character
  783. + value Y.
  784. + .PP
  785. + For example, with the default value for the \fBgrades\fP variable,
  786. + the following file will use smtp for hosts \fBlocal1\fP and \fBlocal2\fP,
  787. + if the precedence is air-mail or better; otherwise, for any host
  788. + with a precedence of first-class or better, demand-polled uucp is
  789. + used; otherwise, queued uucp is used:
  790. + .nf
  791. +     local1/*-A    smtp
  792. +     local2/*-A    smtp
  793. +     */*-C        demand_uucp
  794. +     *        uucp
  795. + .fi
  796.   .SH "THE TRANSPORT FILE"
  797.   The
  798.   .I transport
  799.  
  800. Index: pd/binmail/binmail.c
  801. ***************
  802. *** 1,4 ****
  803. ! /* @(#)pd/binmail/binmail.c    1.3 27 May 1991 15:13:59 */
  804.   
  805.   /* This program will be used in place of /bin/mail on System V sites.
  806.    * It looks at the arguments and decides whether to call
  807. --- 1,4 ----
  808. ! /* @(#)pd/binmail/binmail.c    1.4 24 Jul 1991 00:32:22 */
  809.   
  810.   /* This program will be used in place of /bin/mail on System V sites.
  811.    * It looks at the arguments and decides whether to call
  812. ***************
  813. *** 131,137 ****
  814.   usage()
  815.   {
  816.       int i;
  817. !     char *usage_text[] = {
  818.       "Usage:    %s [-ehpPqr] [-f file] [-x debug]",
  819.       "    %s [-tosw] [-m message_type] [-T file] [-x debug] addr ...",
  820.       "    %s [-x debuglevel] -F addr ..."
  821. --- 131,137 ----
  822.   usage()
  823.   {
  824.       int i;
  825. !     static char *usage_text[] = {
  826.       "Usage:    %s [-ehpPqr] [-f file] [-x debug]",
  827.       "    %s [-tosw] [-m message_type] [-T file] [-x debug] addr ...",
  828.       "    %s [-x debuglevel] -F addr ..."
  829.  
  830. Index: pd/getopt/get_opt.c
  831. ***************
  832. *** 1,5 ****
  833.   /*
  834. !  * @(#)pd/getopt/get_opt.c    1.2 24 Oct 1990 05:19:04
  835.    */
  836.   
  837.   /*
  838. --- 1,5 ----
  839.   /*
  840. !  * @(#)pd/getopt/get_opt.c    1.3 03 Jun 1991 02:09:04
  841.    */
  842.   
  843.   /*
  844. ***************
  845. *** 24,34 ****
  846.    * However, I am not about to post a copy of anything licensed by AT&T.
  847.    */
  848.   
  849.   #include "defs.h"
  850.   
  851.   /*LINTLIBRARY*/
  852. - #define NULL    0
  853. - #define EOF    (-1)
  854.   #define ERR(s, c)    if(opterr){\
  855.       extern int write();\
  856.       char errbuf[2];\
  857. --- 24,33 ----
  858.    * However, I am not about to post a copy of anything licensed by AT&T.
  859.    */
  860.   
  861. + #include <stdio.h>
  862.   #include "defs.h"
  863.   
  864.   /*LINTLIBRARY*/
  865.   #define ERR(s, c)    if(opterr){\
  866.       extern int write();\
  867.       char errbuf[2];\
  868.  
  869. Index: pd/pathalias/arpatxt.c
  870. ***************
  871. *** 39,45 ****
  872.   long fold();
  873.   FILE *mkfile();
  874.   
  875. ! extern char *malloc(), *index(), *calloc(), *gets(), *strcpy(), *fgets();
  876.   extern FILE *fopen();
  877.   
  878.   #define ISADOMAIN(n) ((n) && *((n)->name) == '.')
  879. --- 39,45 ----
  880.   long fold();
  881.   FILE *mkfile();
  882.   
  883. ! extern char *malloc(), *index(), *calloc(), *gets(), *fgets();
  884.   extern FILE *fopen();
  885.   
  886.   #define ISADOMAIN(n) ((n) && *((n)->name) == '.')
  887.  
  888. Index: pd/pathalias/config.h
  889. ***************
  890. *** 75,85 ****
  891.   #else /*!BZERO*/
  892.   
  893.   #ifdef MEMSET
  894. - #ifdef __STDC__
  895. - extern void    *memset();
  896. - #else    /* __STDC__ */
  897. - extern char    *memset();
  898. - #endif    /* __STDC__ */
  899.   #define strclear(s, n)    ((void) memset((s), 0, (n)))
  900.   #else /*!MEMSET*/
  901.   extern void    strclear();
  902. --- 75,80 ----
  903.  
  904. Index: pd/pathalias/mapaux.c
  905. ***************
  906. *** 22,29 ****
  907.   extern link *newlink();
  908.   extern node *newnode();
  909.   extern char *strsave();
  910. - extern int strcmp();
  911. - /* extern int strlen(); - declaration differs in ANSI C */
  912.   
  913.   /* exports */
  914.   long pack();
  915. --- 22,27 ----
  916.  
  917. Index: pd/pathalias/mem.c
  918. ***************
  919. *** 207,213 ****
  920. --- 207,217 ----
  921.    * which are returned to the heap with addtoheap(). 
  922.    */
  923.   
  924. + #ifdef __STDC__
  925. + void    *
  926. + #else
  927.   char    *
  928. + #endif
  929.   mymalloc(n)
  930.       register unsigned int n;
  931.   {    static unsigned int size; /* how much do we have on hand? */
  932.  
  933. Index: pd/pathalias/parse.y
  934. ***************
  935. *** 20,26 ****
  936.   extern node *addnode(), *addprivate();
  937.   extern void fixprivate(), alias(), deadlink(), deletelink();
  938.   extern link *addlink();
  939. - extern int strcmp();
  940.   extern char *strsave();
  941.   extern int optind;
  942.   extern char *Cfile, *Netchars, **Argv;
  943. --- 20,25 ----
  944.  
  945. Index: pd/uuwho/uuwho.c
  946. ***************
  947. *** 1,4 ****
  948. ! /* @(#)pd/uuwho/uuwho.c    1.2 24 Oct 1990 05:19:37 */
  949.   /*
  950.    * uuwho:
  951.    *    store/retrieve uucp map info in dbm format
  952. --- 1,4 ----
  953. ! /* @(#)pd/uuwho/uuwho.c    1.4 24 Jul 1991 01:00:08 */
  954.   /*
  955.    * uuwho:
  956.    *    store/retrieve uucp map info in dbm format
  957. ***************
  958. *** 49,55 ****
  959.   char line[BUFSIZ + 1];
  960.   FILE *fp;
  961.   
  962. - extern char *strcpy();
  963.   extern int errno;    /* last system error */
  964.   
  965.   main(argc, argv)
  966. --- 49,54 ----
  967. ***************
  968. *** 67,73 ****
  969.       position *p;        /* the fetched record */
  970.       extern char *optarg;    /* the arg of a flag */
  971.       extern int optind;        /* the first non flag */
  972. !     
  973.       /*
  974.        * parse args
  975.        */
  976. --- 66,72 ----
  977.       position *p;        /* the fetched record */
  978.       extern char *optarg;    /* the arg of a flag */
  979.       extern int optind;        /* the first non flag */
  980.       /*
  981.        * parse args
  982.        */
  983. ***************
  984. *** 165,182 ****
  985.       char *tp;            /* pointer */
  986.       char c;            /* the char we are looking at */
  987.       char unknown[2];        /* unknown #x line name */
  988.       
  989.       /*
  990.        * open the file
  991.        */
  992. !     if ((fp = fopen(p->name, "r")) == (FILE *)NULL) {
  993.       fprintf(stderr, "%s: Can't open data file %s\n",
  994. !         cmdname, p->name);
  995.       return;
  996.       }
  997.       
  998.       /* seek to the starting location in the file */
  999. !     fseek(fp, p->pos, 0);
  1000.       
  1001.       /*
  1002.        * process the entry one line at a time
  1003. --- 164,187 ----
  1004.       char *tp;            /* pointer */
  1005.       char c;            /* the char we are looking at */
  1006.       char unknown[2];        /* unknown #x line name */
  1007. +     position pos;
  1008. +     /*
  1009. +      * Avoid alignment problems by making a copy of the structure.
  1010. +      */
  1011. +     (void) memcpy((char *) &pos, (char *) p, sizeof pos);
  1012.       
  1013.       /*
  1014.        * open the file
  1015.        */
  1016. !     if ((fp = fopen(pos.name, "r")) == (FILE *)NULL) {
  1017.       fprintf(stderr, "%s: Can't open data file %s\n",
  1018. !         cmdname, pos.name);
  1019.       return;
  1020.       }
  1021.       
  1022.       /* seek to the starting location in the file */
  1023. !     fseek(fp, pos.pos, 0);
  1024.       
  1025.       /*
  1026.        * process the entry one line at a time
  1027.  
  1028. Index: src/addr.c
  1029. ***************
  1030. *** 1,4 ****
  1031. ! /* @(#)src/addr.c    1.2 24 Oct 1990 05:21:33 */
  1032.   
  1033.   /*
  1034.    *    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  1035. --- 1,4 ----
  1036. ! /* @(#)src/addr.c    1.3 23 Jul 1991 19:56:10 */
  1037.   
  1038.   /*
  1039.    *    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  1040. ***************
  1041. *** 1014,1023 ****
  1042. --- 1014,1031 ----
  1043.   {
  1044.       struct addr *next;
  1045.   
  1046. +     DEBUG(DBG_ADDR_MID, "insert_addr_list() called:\n");
  1047. + #ifndef NODEBUG
  1048. +     if (error) {
  1049. +     DEBUG2(DBG_ADDR_MID, "\tERR%ld: %s\n",
  1050. +            error->info, error->message);
  1051. +     }
  1052. + #endif    /* NODEBUG */
  1053.       /* loop over all of the input addrs */
  1054.       for (; in; in = next) {
  1055.       next = in->succ;
  1056.   
  1057. +     DEBUG1(DBG_ADDR_MID, "\t%s\n", in->in_addr);
  1058.       if (error) {
  1059.           in->error = error;        /* set the error message, if given */
  1060.       }
  1061.  
  1062. Index: src/default.c
  1063. ***************
  1064. *** 1,4 ****
  1065. ! /* @(#)src/default.c    1.3 22 Feb 1991 23:19:02 */
  1066.   
  1067.   /*
  1068.    *    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  1069. --- 1,4 ----
  1070. ! /* @(#)src/default.c    1.4 24 Jul 1991 03:12:10 */
  1071.   
  1072.   /*
  1073.    *    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  1074. ***************
  1075. *** 463,470 ****
  1076.    */
  1077.   static struct method method_table[] = {
  1078.   /* you could list sites you wish to poll on demand, for example:
  1079. !  *  { "ihnp4",    "demand" },
  1080. !  *  { "mcvax",    "demand" },
  1081.    * if some sites require a different transport, make a transport
  1082.    * entry and give its name instead of "demand" or "uux".
  1083.    *
  1084. --- 463,470 ----
  1085.    */
  1086.   static struct method method_table[] = {
  1087.   /* you could list sites you wish to poll on demand, for example:
  1088. !  *  { "ihnp4",    -1, -1, "demand" },
  1089. !  *  { "mcvax",    -1, -1, "demand" },
  1090.    * if some sites require a different transport, make a transport
  1091.    * entry and give its name instead of "demand" or "uux".
  1092.    *
  1093. ***************
  1094. *** 471,478 ****
  1095.    * The uux transport calls uux with the -r flag, so that requests are just
  1096.    * queued, uucico is not started to perform delivery immediately.
  1097.    */
  1098. !     { "*",    "uux" },        /* use "uux" for all other hosts */
  1099. !     { NULL,    0},            /* end of first table */
  1100.   };
  1101.   # define METHOD_TABLE method_table
  1102.   
  1103. --- 471,478 ----
  1104.    * The uux transport calls uux with the -r flag, so that requests are just
  1105.    * queued, uucico is not started to perform delivery immediately.
  1106.    */
  1107. !     { "*",    -1, -1, "uux" },    /* use "uux" for all other hosts */
  1108. !     { NULL,    -1, -1, 0},        /* end of first table */
  1109.   };
  1110.   # define METHOD_TABLE method_table
  1111.   
  1112.  
  1113. Index: src/main.c
  1114. ***************
  1115. *** 1,4 ****
  1116. ! /* @(#)src/main.c    1.6 11 May 1991 18:35:11 */
  1117.   
  1118.   /*
  1119.    *    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  1120. --- 1,4 ----
  1121. ! /* @(#)src/main.c    1.7 02 Jun 1991 19:51:17 */
  1122.   
  1123.   /*
  1124.    *    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  1125. ***************
  1126. *** 21,30 ****
  1127.   #include <pwd.h>
  1128.   #include <signal.h>
  1129.   #include "defs.h"
  1130. ! #ifdef UNIX_BSD
  1131.   # include <sys/time.h>
  1132.   #endif    /* UNIX_BSD */
  1133. - #include <time.h>
  1134.   #if defined(HAVE_RLIMIT)
  1135.   # include <sys/resource.h>
  1136.   #endif    /* HAVE_RLIMIT */
  1137. --- 21,31 ----
  1138.   #include <pwd.h>
  1139.   #include <signal.h>
  1140.   #include "defs.h"
  1141. ! #if defined(POSIX) || !defined(UNIX_BSD)
  1142. ! # include <time.h>
  1143. ! #else
  1144.   # include <sys/time.h>
  1145.   #endif    /* UNIX_BSD */
  1146.   #if defined(HAVE_RLIMIT)
  1147.   # include <sys/resource.h>
  1148.   #endif    /* HAVE_RLIMIT */
  1149.  
  1150. Index: src/modes.c
  1151. ***************
  1152. *** 1,4 ****
  1153. ! /* @(#)src/modes.c    1.3 02 Dec 1990 03:46:28 */
  1154.   
  1155.   /*
  1156.    *    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  1157. --- 1,4 ----
  1158. ! /* @(#)src/modes.c    1.6 24 Jul 1991 18:30:50 */
  1159.   
  1160.   /*
  1161.    *    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  1162. ***************
  1163. *** 27,35 ****
  1164.   #include <sys/stat.h>
  1165.   #include <pwd.h>
  1166.   #include <signal.h>
  1167. ! #include <time.h>
  1168.   #include <errno.h>
  1169.   #include "defs.h"
  1170.   #if    defined(HAVE_BSD_NETWORKING)
  1171.   # ifdef UNIX_CPC
  1172.   #  include <h/types42.h>
  1173. --- 27,40 ----
  1174.   #include <sys/stat.h>
  1175.   #include <pwd.h>
  1176.   #include <signal.h>
  1177.   #include <errno.h>
  1178.   #include "defs.h"
  1179. + #ifndef ISC_SOCKET_TIME_BUG
  1180. + #include <time.h>
  1181. + #endif
  1182.   #if    defined(HAVE_BSD_NETWORKING)
  1183.   # ifdef UNIX_CPC
  1184.   #  include <h/types42.h>
  1185. ***************
  1186. *** 58,63 ****
  1187. --- 63,72 ----
  1188.   # include "error.h"
  1189.   #endif
  1190.   
  1191. + #ifdef UNIX_BSD
  1192. + # include <sys/wait.h>
  1193. + #endif
  1194.   /* variables exported from this file */
  1195.   int daemon_pid = 0;
  1196.   
  1197. ***************
  1198. *** 70,75 ****
  1199. --- 79,100 ----
  1200.   static void set_queue_only();
  1201.   static void do_smtp();
  1202.   
  1203. + /*
  1204. +  * Interactive UNIX 2.2 has a bug in accept().  If accept() is
  1205. +  * interrupted by an alarm signal, accept() does not return from
  1206. +  * waiting for a connection with errno set to EINTR.  Unfortunately
  1207. +  * this is necessary for smail to process its mail queues at regular
  1208. +  * intervals, as specified with the -q option.
  1209. +  *
  1210. +  * Interactive's select() does work correctly, however.  Thus,
  1211. +  * we use select() to determine when to call accept(), and catch
  1212. +  * alarm signals out of select(), instead of out of accept().
  1213. +  */
  1214. + #ifdef ISC_ACCEPT_BUG
  1215. + fd_set    fds_used, fds_read;
  1216. + #endif
  1217.   
  1218.   /*
  1219.    * build_host_strings - build the various types of hostnames
  1220. ***************
  1221. *** 727,732 ****
  1222. --- 752,760 ----
  1223.       int as;                /* accept socket */
  1224.       struct sockaddr_in sin, from;    /* from is currently  */
  1225.       struct servent *smtp_service;    /* smtp service file entry */
  1226. + #ifdef ISC_ACCEPT_BUG
  1227. +     int nsel;
  1228. + #endif
  1229.   
  1230.       X_PANIC_OKAY();
  1231.   
  1232. ***************
  1233. *** 794,799 ****
  1234. --- 822,841 ----
  1235.       DEBUG1(DBG_MAIN_MID, "listening on port %d...\n",
  1236.              smtp_service->s_port);
  1237.   
  1238. + #ifdef ISC_ACCEPT_BUG
  1239. +     FD_ZERO(&fds_used);
  1240. +     FD_SET(ls, &fds_used);
  1241. +     memcpy(&fds_read, &fds_used, sizeof(&fds_read));
  1242. +     nsel = select(ls + 1, &fds_read, (char *)0, (char *)0, (char *)0);
  1243. +     if (nsel < 0) {
  1244. +         if (errno != EINTR) {
  1245. +         write_log(LOG_PANIC, "select failed: %s", strerrno());
  1246. +         continue;
  1247. +         }
  1248. +     } else {
  1249. + #endif    /* ISC_ACCEPT_BUG */
  1250.       /* get connection */
  1251.       as = accept(ls, (struct sockaddr *)&from, &len);
  1252.       if (as < 0 && errno != EINTR) {
  1253. ***************
  1254. *** 803,808 ****
  1255. --- 845,855 ----
  1256.       if (as >= 0) {
  1257.           do_daemon_accept(ls, as, &from);
  1258.       }
  1259. + #ifdef ISC_ACCEPT_BUG
  1260. +     }
  1261. + #endif
  1262.       if (got_sighup) {
  1263.           write_log(LOG_SYS, "pid %d: SIGHUP received, exec(%s)",
  1264.                 getpid(), smail);
  1265. ***************
  1266. *** 921,928 ****
  1267.   /*
  1268.    * daemon_sighup - note that we received a SIGHUP signal
  1269.    */
  1270.   static void
  1271. ! daemon_sighup()
  1272.   {
  1273.       got_sighup = TRUE;
  1274.       (void) signal(SIGHUP, daemon_sighup);
  1275. --- 968,977 ----
  1276.   /*
  1277.    * daemon_sighup - note that we received a SIGHUP signal
  1278.    */
  1279. + /*ARGSUSED*/
  1280.   static void
  1281. ! daemon_sighup(sig)
  1282. !     int sig;
  1283.   {
  1284.       got_sighup = TRUE;
  1285.       (void) signal(SIGHUP, daemon_sighup);
  1286. ***************
  1287. *** 932,943 ****
  1288.   /*
  1289.    * daemon_sigchld - reap dead kids
  1290.    */
  1291.   static void
  1292. ! daemon_sigchld()
  1293.   {
  1294.       (void) wait((int *)0);
  1295.       /* for System V we setup signal again */
  1296.       (void) signal(SIGCHLD, daemon_sigchld);
  1297.   }
  1298.   #endif    /* SIGCHLD */
  1299.   
  1300. --- 981,999 ----
  1301.   /*
  1302.    * daemon_sigchld - reap dead kids
  1303.    */
  1304. + /*ARGSUSED*/
  1305.   static void
  1306. ! daemon_sigchld(sig)
  1307. !     int sig;
  1308.   {
  1309. + #ifdef UNIX_BSD
  1310. +     while (wait3((int *)0, WNOHANG, 0) > 0)
  1311. +     ;
  1312. + #else
  1313.       (void) wait((int *)0);
  1314.       /* for System V we setup signal again */
  1315.       (void) signal(SIGCHLD, daemon_sigchld);
  1316. + #endif
  1317.   }
  1318.   #endif    /* SIGCHLD */
  1319.   
  1320. ***************
  1321. *** 944,951 ****
  1322.   /*
  1323.    * daemon_sigalrm - note that we received a SIGALRM signal
  1324.    */
  1325.   static void
  1326. ! daemon_sigalrm()
  1327.   {
  1328.       got_sigalrm = TRUE;
  1329.       (void) signal(SIGALRM, daemon_sigalrm);
  1330. --- 1000,1009 ----
  1331.   /*
  1332.    * daemon_sigalrm - note that we received a SIGALRM signal
  1333.    */
  1334. + /*ARGSUSED*/
  1335.   static void
  1336. ! daemon_sigalrm(sig)
  1337. !     int sig;
  1338.   {
  1339.       got_sigalrm = TRUE;
  1340.       (void) signal(SIGALRM, daemon_sigalrm);
  1341.  
  1342. Index: src/notify.c
  1343. ***************
  1344. *** 1,4 ****
  1345. ! /* @(#)src/notify.c    1.3 27 May 1991 15:17:18 */
  1346.   
  1347.   /*
  1348.    *    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  1349. --- 1,4 ----
  1350. ! /* @(#)src/notify.c    1.4 24 Jul 1991 02:19:06 */
  1351.   
  1352.   /*
  1353.    *    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  1354. ***************
  1355. *** 67,73 ****
  1356.   {
  1357.       register struct addr *cur;
  1358.   
  1359. !     if (cur && exitvalue == EX_OK) {
  1360.       exitvalue = EX_UNAVAILABLE;
  1361.       }
  1362.   
  1363. --- 67,73 ----
  1364.   {
  1365.       register struct addr *cur;
  1366.   
  1367. !     if (addr && exitvalue == EX_OK) {
  1368.       exitvalue = EX_UNAVAILABLE;
  1369.       }
  1370.   
  1371. ***************
  1372. *** 110,116 ****
  1373.       struct addr *cur;
  1374.       struct defer_addr *link;
  1375.   
  1376. !     if (cur && exitvalue == EX_OK) {
  1377.       exitvalue = EX_TEMPFAIL;
  1378.       }
  1379.   
  1380. --- 110,116 ----
  1381.       struct addr *cur;
  1382.       struct defer_addr *link;
  1383.   
  1384. !     if (addr && exitvalue == EX_OK) {
  1385.       exitvalue = EX_TEMPFAIL;
  1386.       }
  1387.   
  1388.  
  1389. Index: src/queue.c
  1390. ***************
  1391. *** 1,4 ****
  1392. ! /* @(#)src/queue.c    1.6 18 Feb 1991 16:36:55 */
  1393.   
  1394.   /*
  1395.    *    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  1396. --- 1,4 ----
  1397. ! /* @(#)src/queue.c    1.7 03 Jun 1991 02:34:24 */
  1398.   
  1399.   /*
  1400.    *    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  1401. ***************
  1402. *** 761,766 ****
  1403. --- 761,767 ----
  1404.       if (c != EOF) {
  1405.           STR_NEXT(line, c);
  1406.       }
  1407. +     STR_NEXT(line, '\0');
  1408.       lp = line->p;
  1409.       if (line->i < 20) {
  1410.           /* less than 20 chars? couldn't possibly be a From_ line */
  1411.  
  1412. Index: src/route.c
  1413. ***************
  1414. *** 1,4 ****
  1415. ! /* @(#)src/route.c    1.2 24 Oct 1990 05:24:17 */
  1416.   
  1417.   /*
  1418.    *    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  1419. --- 1,4 ----
  1420. ! /* @(#)src/route.c    1.3 24 Jul 1991 03:12:16 */
  1421.   
  1422.   /*
  1423.    *    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  1424. ***************
  1425. *** 19,24 ****
  1426. --- 19,25 ----
  1427.    *                read_router_file, read_method_file
  1428.    */
  1429.   #include <stdio.h>
  1430. + #include <ctype.h>
  1431.   #include <sys/types.h>
  1432.   #include <sys/stat.h>
  1433.   #include "defs.h"
  1434. ***************
  1435. *** 706,712 ****
  1436.   
  1437.       mp = rp->method;
  1438.       while (mp->host) {
  1439. !         if (EQIC(addr->next_host, mp->host) || EQ(mp->host, "*")) {
  1440.           /* found the right transport, use it */
  1441.           addr->transport = find_transport(mp->transport);
  1442.           if (addr->transport == NULL) {
  1443. --- 707,715 ----
  1444.   
  1445.       mp = rp->method;
  1446.       while (mp->host) {
  1447. !         if ((EQIC(addr->next_host, mp->host) || EQ(mp->host, "*")) &&
  1448. !             (mp->mingrade < 0 || msg_grade >= mp->mingrade &&
  1449. !             msg_grade <= mp->maxgrade)) {
  1450.           /* found the right transport, use it */
  1451.           addr->transport = find_transport(mp->transport);
  1452.           if (addr->transport == NULL) {
  1453. ***************
  1454. *** 969,974 ****
  1455. --- 972,978 ----
  1456.       struct method *methods;        /* method table */
  1457.       int ct = 0;                /* count of methods */
  1458.       char *entry;            /* text of file entry */
  1459. +     char *mgrade;            /* restricted grades for this method */
  1460.       struct stat statbuf;
  1461.   
  1462.       if (f == NULL) {
  1463. ***************
  1464. *** 991,1001 ****
  1465.       if (new == NULL) {
  1466.           return NULL;
  1467.       }
  1468. -     ct++;
  1469.       methods = (struct method *)
  1470. !         xrealloc((char *)methods, (ct + 1)*sizeof(*methods));
  1471. !     methods[ct - 1].host = new->name;
  1472. !     methods[ct - 1].transport = new->value;
  1473.       }
  1474.   
  1475.       /* zero out the ending record */
  1476. --- 995,1024 ----
  1477.       if (new == NULL) {
  1478.           return NULL;
  1479.       }
  1480.       methods = (struct method *)
  1481. !         xrealloc((char *)methods, (ct + 2)*sizeof(*methods));
  1482. !     methods[ct].host = new->name;
  1483. !     methods[ct].mingrade = -1;
  1484. !     methods[ct].maxgrade = -1;
  1485. !     methods[ct].transport = new->value;
  1486. !     mgrade = strchr(new->name, '/');
  1487. !     if (mgrade != NULL) {
  1488. !         *mgrade++ = '\0';
  1489. !         if (isalnum(mgrade[0])) {
  1490. !         methods[ct].mingrade = mgrade[0];
  1491. !         methods[ct].maxgrade = mgrade[0];
  1492. !         }
  1493. !         if (mgrade[1] == '-') {
  1494. !         if (isalnum(mgrade[2])) {
  1495. !              methods[ct].maxgrade = mgrade[2];
  1496. !         } else {
  1497. !              methods[ct].maxgrade = 255;
  1498. !         }
  1499. !         if (methods[ct].mingrade == -1)
  1500. !              methods[ct].mingrade = 0;
  1501. !         }
  1502. !     }
  1503. !     ct++;
  1504.       }
  1505.   
  1506.       /* zero out the ending record */
  1507.  
  1508. Index: src/route.h
  1509. ***************
  1510. *** 1,4 ****
  1511. ! /* @(#)src/route.h    1.2 24 Oct 1990 05:24:21 */
  1512.   
  1513.   /*
  1514.    *    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  1515. --- 1,4 ----
  1516. ! /* @(#)src/route.h    1.3 24 Jul 1991 03:12:21 */
  1517.   
  1518.   /*
  1519.    *    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  1520. ***************
  1521. *** 30,35 ****
  1522. --- 30,37 ----
  1523.   /* method - table associating hosts and transports */
  1524.   struct method {
  1525.       char *host;                /* host name */
  1526. +     int mingrade;            /* min grading for this entry */
  1527. +     int maxgrade;            /* max grading for this entry */
  1528.       char *transport;            /* transport name */
  1529.   };
  1530.   
  1531.  
  1532. Index: src/routers/bind.c
  1533. ***************
  1534. *** 1,4 ****
  1535. ! /* @(#)src/routers/bind.c    1.5 28 May 1991 02:09:32 */
  1536.   
  1537.   /*
  1538.    *    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  1539. --- 1,4 ----
  1540. ! /* @(#)src/routers/bind.c    1.8 24 Jul 1991 03:35:03 */
  1541.   
  1542.   /*
  1543.    *    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  1544. ***************
  1545. *** 240,246 ****
  1546.       { "local_mx_okay", t_boolean, NULL, NULL, BIND_LOCAL_MX_OKAY },
  1547.       { "defer_no_connect", t_boolean, NULL, NULL, BIND_DEFER_NO_CONN },
  1548.       { "defnames", t_boolean, NULL, NULL, BIND_DEFNAMES },
  1549. !     { "defnames", t_boolean, NULL, NULL, BIND_DEFNAMES },
  1550.       { "ignore_domains", t_string, NULL, NULL,
  1551.         OFFSET(bind_private, ignore_domains) },
  1552.       };
  1553. --- 240,247 ----
  1554.       { "local_mx_okay", t_boolean, NULL, NULL, BIND_LOCAL_MX_OKAY },
  1555.       { "defer_no_connect", t_boolean, NULL, NULL, BIND_DEFER_NO_CONN },
  1556.       { "defnames", t_boolean, NULL, NULL, BIND_DEFNAMES },
  1557. !     { "domain_required", t_boolean, NULL, NULL, BIND_DOMAIN_REQUIRED },
  1558. !     { "mx_only", t_boolean, NULL, NULL, BIND_MX_ONLY },
  1559.       { "ignore_domains", t_string, NULL, NULL,
  1560.         OFFSET(bind_private, ignore_domains) },
  1561.       };
  1562. ***************
  1563. *** 330,335 ****
  1564. --- 331,337 ----
  1565.        * known not to exist in the DNS, such as .uucp or .bitnet.
  1566.        */
  1567.   
  1568. +     target = strip_dots(addr->target);
  1569.       if (priv->ignore_domains) {
  1570.       if (match_end_domain(priv->ignore_domains, target) != NULL) {
  1571.           return DB_NOMATCH;
  1572. ***************
  1573. *** 350,356 ****
  1574.   
  1575.       /* Step 1:  Strip extra dots */
  1576.       /* store return values for common case */
  1577. !     rt_info->next_host = target = strip_dots(addr->target);
  1578.       rt_info->route = NULL;
  1579.       rt_info->matchlen = strlen(addr->target);
  1580.   
  1581. --- 352,358 ----
  1582.   
  1583.       /* Step 1:  Strip extra dots */
  1584.       /* store return values for common case */
  1585. !     rt_info->next_host = target;
  1586.       rt_info->route = NULL;
  1587.       rt_info->matchlen = strlen(addr->target);
  1588.   
  1589. ***************
  1590. *** 679,686 ****
  1591.       char msgbuf[MAXPACKET];
  1592.       int msglen;
  1593.       int anslen;
  1594.   
  1595. !     msglen = res_mkquery(QUERY, qname, C_ANY, qtype, (char *)NULL, 0,
  1596.                (struct rrec *)NULL, msgbuf, MAXPACKET);
  1597.   
  1598.       anslen = res_send(msgbuf, msglen,  (char *)answer, MAXPACKET);
  1599. --- 681,694 ----
  1600.       char msgbuf[MAXPACKET];
  1601.       int msglen;
  1602.       int anslen;
  1603. +     static int inited = FALSE;
  1604.   
  1605. !     if (!inited) {
  1606. !     res_init();
  1607. !     inited = TRUE;
  1608. !     }
  1609. !     msglen = res_mkquery(QUERY, qname, C_IN, qtype, (char *)NULL, 0,
  1610.                (struct rrec *)NULL, msgbuf, MAXPACKET);
  1611.   
  1612.       anslen = res_send(msgbuf, msglen,  (char *)answer, MAXPACKET);
  1613.  
  1614. Index: src/spool.c
  1615. ***************
  1616. *** 1,4 ****
  1617. ! /* @(#)src/spool.c    1.2 24 Oct 1990 05:25:19 */
  1618.   
  1619.   /*
  1620.    *    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  1621. --- 1,4 ----
  1622. ! /* @(#)src/spool.c    1.4 23 Jul 1991 22:04:03 */
  1623.   
  1624.   /*
  1625.    *    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  1626. ***************
  1627. *** 43,60 ****
  1628.   # include "extern.h"
  1629.   #endif
  1630.   
  1631. ! #ifdef UNIX_BSD
  1632. ! # include <sys/time.h>
  1633. ! #else    /* not UNIX_BSD */
  1634.   # include <time.h>
  1635.   #endif    /* not UNIX_BSD */
  1636.   
  1637. ! #ifdef UNIX_SYS5
  1638.   # include <fcntl.h>
  1639.   #endif
  1640. - #ifdef UNIX_BSD
  1641. - # include <sys/file.h>
  1642. - #endif
  1643.   
  1644.   #ifdef STANDALONE
  1645.   # define xmalloc malloc
  1646. --- 43,61 ----
  1647.   # include "extern.h"
  1648.   #endif
  1649.   
  1650. ! #if defined(POSIX_OS) || !defined(UNIX_BSD)
  1651.   # include <time.h>
  1652. + #else    /* not UNIX_BSD */
  1653. + # include <sys/time.h>
  1654.   #endif    /* not UNIX_BSD */
  1655.   
  1656. ! #if defined(UNIX_SYS5) || defined(POSIX_OS)
  1657.   # include <fcntl.h>
  1658. + #else
  1659. + # ifdef UNIX_BSD
  1660. + #  include <sys/file.h>
  1661. + # endif
  1662.   #endif
  1663.   
  1664.   #ifdef STANDALONE
  1665.   # define xmalloc malloc
  1666. ***************
  1667. *** 88,94 ****
  1668.       struct log_msgs *succ;
  1669.   } *log_msgs;                /* message lines to send to log */
  1670.   static struct log_msgs **next_log_msg;    /* where to put next log message */
  1671. ! static enum locker { l_creat, l_open, l_lock };    /* who is trying to lock */
  1672.   
  1673.   /* functions local to this file */
  1674.   static int int_creat_spool();
  1675. --- 89,97 ----
  1676.       struct log_msgs *succ;
  1677.   } *log_msgs;                /* message lines to send to log */
  1678.   static struct log_msgs **next_log_msg;    /* where to put next log message */
  1679. ! /* types local to this file */
  1680. ! enum locker { l_creat, l_open, l_lock };    /* who is trying to lock */
  1681.   
  1682.   /* functions local to this file */
  1683.   static int int_creat_spool();
  1684.  
  1685. Index: src/sysdep.c
  1686. ***************
  1687. *** 1,4 ****
  1688. ! /* @(#)src/sysdep.c    1.4 27 May 1991 18:49:48 */
  1689.   
  1690.   /*
  1691.    *    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  1692. --- 1,4 ----
  1693. ! /* @(#)src/sysdep.c    1.6 03 Jun 1991 02:07:56 */
  1694.   
  1695.   /*
  1696.    *    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  1697. ***************
  1698. *** 40,45 ****
  1699. --- 40,49 ----
  1700.   #endif
  1701.   #if defined(UNIX_SYS5) || defined(POSIX_OS) || defined(USE_FCNTL)
  1702.   # include <fcntl.h>
  1703. + #else
  1704. + # if defined(UNIX_BSD)
  1705. + #  include <sys/file.h>
  1706. + # endif
  1707.   #endif
  1708.   
  1709.   #if defined(POSIX_OS)
  1710. ***************
  1711. *** 51,60 ****
  1712.   # include <sys/utsname.h>
  1713.   #endif
  1714.   
  1715. ! #if     defined(UNIX_BSD)
  1716.   # include <sys/dir.h>
  1717.   #else
  1718. ! # if    defined(UNIX_XENIX)
  1719.   #  include <sys/ndir.h>
  1720.   # else
  1721.   #  if    defined(HAVE_READDIR)
  1722. --- 55,64 ----
  1723.   # include <sys/utsname.h>
  1724.   #endif
  1725.   
  1726. ! #if     defined(UNIX_BSD) && !defined(POSIX_OS)
  1727.   # include <sys/dir.h>
  1728.   #else
  1729. ! # if    defined(UNIX_XENIX) && !defined(POSIX_OS)
  1730.   #  include <sys/ndir.h>
  1731.   # else
  1732.   #  if    defined(HAVE_READDIR)
  1733. ***************
  1734. *** 62,76 ****
  1735.   #   define direct dirent
  1736.   #  else
  1737.   #   include <sys/dir.h>
  1738. ! #  endif /* defined(HAVE_READDIR) */
  1739. ! # endif    /* not defined(UNIX_XENIX) */
  1740. ! #endif    /* not defined(UNIX_BSD) */
  1741.   
  1742. ! #if    defined(UNIX_BSD) || defined(USE_SYS_TIME)
  1743. ! # include <sys/time.h>
  1744. ! # include <sys/file.h>
  1745. ! #else
  1746.   # include <time.h>
  1747.   #endif
  1748.   
  1749.   #if !defined(UNIX_BSD) && !defined(UNIX_SYS5) && !defined(POSIX_OS)
  1750. --- 66,79 ----
  1751.   #   define direct dirent
  1752.   #  else
  1753.   #   include <sys/dir.h>
  1754. ! #  endif /* HAVE_READDIR */
  1755. ! # endif    /* UNIX_XENIX && !POSIX_OS */
  1756. ! #endif    /* UNIX_BSD && !POSIX_OS */
  1757.   
  1758. ! #if defined(POSIX_OS) || !defined(UNIX_BSD)
  1759.   # include <time.h>
  1760. + #else
  1761. + # include <sys/time.h>
  1762.   #endif
  1763.   
  1764.   #if !defined(UNIX_BSD) && !defined(UNIX_SYS5) && !defined(POSIX_OS)
  1765. ***************
  1766. *** 622,628 ****
  1767.       int no_trunc_flag;
  1768.       int name_max;
  1769.   
  1770. !     if (strlen(p) > _POSIX_NAME_MAX - 2) {
  1771.           *(p - 1) = '\0';
  1772.           no_trunc_flag = pathconf(fn, _PC_NO_TRUNC);
  1773.           if (! no_trunc_flag) {
  1774. --- 625,631 ----
  1775.       int no_trunc_flag;
  1776.       int name_max;
  1777.   
  1778. !     if ((int)strlen(p) > _POSIX_NAME_MAX - 2) {
  1779.           *(p - 1) = '\0';
  1780.           no_trunc_flag = pathconf(fn, _PC_NO_TRUNC);
  1781.           if (! no_trunc_flag) {
  1782. ***************
  1783. *** 631,637 ****
  1784.           *(p - 1) = '\0';
  1785.           if (no_trunc_flag < 0 || name_max < 0)
  1786.           return FAIL;
  1787. !         if (! no_trunc_flag && strlen(p) > name_max - 2) {
  1788.           /*
  1789.            * If there is not enough room to append a .l, then
  1790.            * always succeed the lock operation.  This is dangerous
  1791. --- 634,640 ----
  1792.           *(p - 1) = '\0';
  1793.           if (no_trunc_flag < 0 || name_max < 0)
  1794.           return FAIL;
  1795. !         if (! no_trunc_flag && (int)strlen(p) > name_max - 2) {
  1796.           /*
  1797.            * If there is not enough room to append a .l, then
  1798.            * always succeed the lock operation.  This is dangerous
  1799. ***************
  1800. *** 904,910 ****
  1801.       int no_trunc_flag;
  1802.       int name_max;
  1803.   
  1804. !     if (strlen(p) > _POSIX_NAME_MAX - 2) {
  1805.           *(p - 1) = '\0';
  1806.           no_trunc_flag = pathconf(fn, _PC_NO_TRUNC);
  1807.           if (! no_trunc_flag) {
  1808. --- 907,913 ----
  1809.       int no_trunc_flag;
  1810.       int name_max;
  1811.   
  1812. !     if ((int)strlen(p) > _POSIX_NAME_MAX - 2) {
  1813.           *(p - 1) = '\0';
  1814.           no_trunc_flag = pathconf(fn, _PC_NO_TRUNC);
  1815.           if (! no_trunc_flag) {
  1816. ***************
  1817. *** 913,919 ****
  1818.           *(p - 1) = '\0';
  1819.           if (no_trunc_flag < 0 || name_max < 0)
  1820.           return;        /* directory not found? */
  1821. !         if (! no_trunc_flag && strlen(p) > name_max - 2) {
  1822.           /*
  1823.            * If there is not enough room to append a .l, then
  1824.            * the lock operation should not have created a
  1825. --- 916,922 ----
  1826.           *(p - 1) = '\0';
  1827.           if (no_trunc_flag < 0 || name_max < 0)
  1828.           return;        /* directory not found? */
  1829. !         if (! no_trunc_flag && (int)strlen(p) > name_max - 2) {
  1830.           /*
  1831.            * If there is not enough room to append a .l, then
  1832.            * the lock operation should not have created a
  1833. ***************
  1834. *** 1158,1164 ****
  1835.   
  1836.       /* keep trying to create a fork until we succeed or retries == 0 */
  1837.       while (
  1838. ! #if    defined(UNIX_BSD) || defined(HAVE_VFORK)
  1839.          (pid = (argv? vfork(): fork())) < 0 &&
  1840.   #else    /* not UNIX_BSD && not HAVE_VFORK */
  1841.          (pid = fork()) < 0 &&
  1842. --- 1161,1167 ----
  1843.   
  1844.       /* keep trying to create a fork until we succeed or retries == 0 */
  1845.       while (
  1846. ! #if    (defined(UNIX_BSD) || defined(HAVE_VFORK)) && !defined(DONT_USE_VFORK)
  1847.          (pid = (argv? vfork(): fork())) < 0 &&
  1848.   #else    /* not UNIX_BSD && not HAVE_VFORK */
  1849.          (pid = fork()) < 0 &&
  1850.  
  1851. Index: src/transports/appendfile.c
  1852. ***************
  1853. *** 1,4 ****
  1854. ! /* @(#)src/transports/appendfile.c    1.5 27 May 1991 18:17:56 */
  1855.   
  1856.   /*
  1857.    *    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  1858. --- 1,4 ----
  1859. ! /* @(#)src/transports/appendfile.c    1.7 24 Jul 1991 00:35:48 */
  1860.   
  1861.   /*
  1862.    *    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  1863. ***************
  1864. *** 73,93 ****
  1865.   #include <sys/types.h>
  1866.   #include <sys/stat.h>
  1867.   #include "defs.h"
  1868. ! #ifdef UNIX_SYS5
  1869.   # include <fcntl.h>
  1870.   #endif
  1871. ! #ifdef UNIX_BSD
  1872.   # include <sys/file.h>
  1873.   #endif
  1874. ! #if defined(UNIX_SYS5) || defined(HAVE_UTIME)
  1875.   # include <utime.h>
  1876.   # define RESTORE_ATIME
  1877. ! #else    /* not UNIX_SYS5 && not HAVE_UTIME */
  1878. ! # if defined(UNIX_BSD) || defined(HAVE_UTIMES)
  1879. ! #  include <sys/time.h>
  1880.   #  define RESTORE_ATIME
  1881. ! # endif    /* UNIX_BSD || HAVE_UTIMES */
  1882. ! #endif    /* UNIX_SYS5 || HAVE_UTIME */
  1883.   #include "../smail.h"
  1884.   #include "../smailconf.h"
  1885.   #include "../parse.h"
  1886. --- 73,108 ----
  1887.   #include <sys/types.h>
  1888.   #include <sys/stat.h>
  1889.   #include "defs.h"
  1890. ! #if defined(UNIX_SYS5) || defined(POSIX_OS)
  1891.   # include <fcntl.h>
  1892.   #endif
  1893. ! #if defined(UNIX_BSD) && !defined(POSIX_OS)
  1894.   # include <sys/file.h>
  1895.   #endif
  1896. ! #ifdef POSIX_OS
  1897.   # include <utime.h>
  1898.   # define RESTORE_ATIME
  1899. ! # undef HAVE_UTIME
  1900. ! # undef HAVE_UTIMES
  1901. ! # define HAVE_UTIME
  1902. ! #else    /* not POSIX_OS */
  1903. ! # if defined(UNIX_SYS5) || defined(HAVE_UTIME)
  1904. ! #  ifdef DECLARE_UTIMBUF
  1905. !      struct utimbuf {
  1906. !     time_t actime;
  1907. !     time_t modtime;
  1908. !      };
  1909. ! #  else
  1910. ! #   include <sys/time.h>
  1911. ! #  endif
  1912.   #  define RESTORE_ATIME
  1913. ! # else
  1914. ! #  if defined(UNIX_BSD) || defined(HAVE_UTIMES)
  1915. ! #   include <sys/time.h>
  1916. ! #   define RESTORE_ATIME
  1917. ! #  endif
  1918. ! # endif
  1919. ! #endif    /* POSIX_OS */
  1920.   #include "../smail.h"
  1921.   #include "../smailconf.h"
  1922.   #include "../parse.h"
  1923. ***************
  1924. *** 737,753 ****
  1925.       struct stat statbuf;
  1926.   #if defined(UNIX_SYS5) || defined(HAVE_UTIME)
  1927.       struct utimbuf times;
  1928. - #else
  1929. -     struct timeval tv[2];
  1930. - #endif
  1931.   
  1932.       if (atime == 0 || stat(fname, &statbuf) < 0)
  1933.       return;
  1934. - #if defined(UNIX_SYS5) || defined(HAVE_UTIME)
  1935.       times.actime = atime;
  1936.       times.modtime = statbuf.st_mtime;
  1937.       (void) utime(fname, ×);
  1938.   #else
  1939.       tv[0].tv_usec = tv[1].tv_usec = 0;
  1940.       tv[0].tv_sec = atime;
  1941.       tv[1].tv_sec = (long)statbuf.st_mtime;
  1942. --- 752,766 ----
  1943.       struct stat statbuf;
  1944.   #if defined(UNIX_SYS5) || defined(HAVE_UTIME)
  1945.       struct utimbuf times;
  1946.   
  1947.       if (atime == 0 || stat(fname, &statbuf) < 0)
  1948.       return;
  1949.       times.actime = atime;
  1950.       times.modtime = statbuf.st_mtime;
  1951.       (void) utime(fname, ×);
  1952.   #else
  1953. +     struct timeval tv[2];
  1954.       tv[0].tv_usec = tv[1].tv_usec = 0;
  1955.       tv[0].tv_sec = atime;
  1956.       tv[1].tv_sec = (long)statbuf.st_mtime;
  1957.  
  1958. Index: src/transports/pipe.c
  1959. ***************
  1960. *** 1,4 ****
  1961. ! /* @(#)src/transports/pipe.c    1.4 27 May 1991 18:18:39 */
  1962.   
  1963.   /*
  1964.    *    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  1965. --- 1,4 ----
  1966. ! /* @(#)src/transports/pipe.c    1.6 23 Jul 1991 19:56:59 */
  1967.   
  1968.   /*
  1969.    *    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  1970. ***************
  1971. *** 47,52 ****
  1972. --- 47,53 ----
  1973.    *        write failed on the pipe.
  1974.    */
  1975.   #include <stdio.h>
  1976. + #include <ctype.h>
  1977.   #include <pwd.h>
  1978.   #include <grp.h>
  1979.   #include <signal.h>
  1980. ***************
  1981. *** 220,225 ****
  1982. --- 221,227 ----
  1983.               fprintf(errfile, "\\%03o", c & 0xff);
  1984.           }
  1985.           }
  1986. +         putc('"', errfile);
  1987.       }
  1988.       putc('\n', errfile);
  1989.       }
  1990.  
  1991. Index: util/Makefile
  1992. ***************
  1993. *** 1,5 ****
  1994.   #!/bin/make -f
  1995. ! # @(#)util/Makefile    1.4 18 Feb 1991 15:21:15
  1996.   # Makefile for the smail utility tools
  1997.   #
  1998.   #    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  1999. --- 1,5 ----
  2000.   #!/bin/make -f
  2001. ! # @(#)util/Makefile    1.5 23 Jul 1991 22:24:11
  2002.   # Makefile for the smail utility tools
  2003.   #
  2004.   #    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  2005. ***************
  2006. *** 38,44 ****
  2007.            mkuuwho mkhpath
  2008.   BIN_TARGETS=mkaliases
  2009.   TARGETS=${UTIL_TARGETS} ${BIN_TARGETS}
  2010. ! STRIP_TARGETS=mkline mksort dcasehost mkdbm pathmerge
  2011.   OBJ=mkline.o mksort.o dcasehost.o mkdbm.o pathmerge.o \
  2012.       gleem.o unsharmap.o ${LOCAL_OBJ}
  2013.   CSRC=mkline.c mksort.c dcasehost.c mkdbm.c pathmerge.c gleem.c unsharmap.c
  2014. --- 38,44 ----
  2015.            mkuuwho mkhpath
  2016.   BIN_TARGETS=mkaliases
  2017.   TARGETS=${UTIL_TARGETS} ${BIN_TARGETS}
  2018. ! STRIP_TARGETS=mkline mksort dcasehost mkdbm pathmerge gleem unsharmap
  2019.   OBJ=mkline.o mksort.o dcasehost.o mkdbm.o pathmerge.o \
  2020.       gleem.o unsharmap.o ${LOCAL_OBJ}
  2021.   CSRC=mkline.c mksort.c dcasehost.c mkdbm.c pathmerge.c gleem.c unsharmap.c
  2022. ***************
  2023. *** 98,105 ****
  2024.          echo ${SHELL} ${INSTM} -m 0555 $$SMAIL_BIN_DIR ${BIN_TARGETS}; \
  2025.          ${SHELL} ${INSTM} -m 0555 $$SMAIL_BIN_DIR ${BIN_TARGETS}; \
  2026.          case "$$STRIP" in \
  2027. !        ?*)    echo "cd $$UTIL_BIN_DIR; strip ${STRIP_TARGETS}"; \
  2028. !         (cd $$UTIL_BIN_DIR; strip ${STRIP_TARGETS});; \
  2029.          esac
  2030.   
  2031.   depend local_depend: check_defs
  2032. --- 98,111 ----
  2033.          echo ${SHELL} ${INSTM} -m 0555 $$SMAIL_BIN_DIR ${BIN_TARGETS}; \
  2034.          ${SHELL} ${INSTM} -m 0555 $$SMAIL_BIN_DIR ${BIN_TARGETS}; \
  2035.          case "$$STRIP" in \
  2036. !        ?*)    for i in ${STRIP_TARGETS}; do \
  2037. !             echo strip $$UTIL_BIN_DIR/$$i; \
  2038. !             strip $$UTIL_BIN_DIR/$$i; \
  2039. !             if [ -x /usr/bin/mcs ]; then \
  2040. !                 echo mcs -d $$UTIL_BIN_DIR/$$i; \
  2041. !                 mcs -d $$UTIL_BIN_DIR/$$i; \
  2042. !             fi; \
  2043. !         done; \
  2044.          esac
  2045.   
  2046.   depend local_depend: check_defs
  2047.  
  2048. Index: util/unsharmap.c
  2049. ***************
  2050. *** 1,4 ****
  2051. ! /* @(#)util/unsharmap.c    1.3 18 Feb 1991 15:24:54 */
  2052.   /*
  2053.    *    Copyright (C) 1988 Ronald S. Karr and Landon Curt Noll
  2054.    * 
  2055. --- 1,4 ----
  2056. ! /* @(#)util/unsharmap.c    1.4 23 Jul 1991 22:06:35 */
  2057.   /*
  2058.    *    Copyright (C) 1988 Ronald S. Karr and Landon Curt Noll
  2059.    * 
  2060. ***************
  2061. *** 506,514 ****
  2062.       }
  2063.   
  2064.       /*
  2065. !      * skip the : lines
  2066.        */
  2067. !     if (buf[0] == ':') {
  2068.           continue;
  2069.       }
  2070.   
  2071. --- 506,514 ----
  2072.       }
  2073.   
  2074.       /*
  2075. !      * skip the : lines and any blank lines
  2076.        */
  2077. !     if (buf[0] == ':' || buf[0] == '\n') {
  2078.           continue;
  2079.       }
  2080.   
  2081.